package com.onpositive.wiki3.catmodels;

import com.onpositive.wiki3.db.catmodel.Category;

public class SystemCategoryModel implements ICategoryModel{

	@Override
	public int score(Category cat) {
		String string = cat.toString();
		if (string.startsWith(".hack")){
			cat.setTag(ICategoryModel.SYSTEM_STUFF);
			return Integer.MAX_VALUE;
			
		}
		if (string.startsWith("user_")){
			cat.setTag(ICategoryModel.SYSTEM_STUFF);
			return Integer.MAX_VALUE;		
		}
		if (string.contains("wikipedia")){
			cat.setTag(ICategoryModel.SYSTEM_STUFF);
			return Integer.MAX_VALUE;		
		}
		if (string.contains("_missing_geocoordinate_data")){
			cat.setTag(ICategoryModel.SYSTEM_STUFF);
			return Integer.MAX_VALUE;		
		}
		if (string.contains("wikiproject")){
			cat.setTag(ICategoryModel.SYSTEM_STUFF);
			return Integer.MAX_VALUE;		
		}
		if (string.contains("templates")){
			cat.setTag(ICategoryModel.SYSTEM_STUFF);
			return Integer.MAX_VALUE;		
		}
		if (string.endsWith("_articles")){
			cat.setTag(ICategoryModel.SYSTEM_STUFF);
			return Integer.MAX_VALUE;		
		}
		if (string.startsWith("articles_")){
			cat.setTag(ICategoryModel.SYSTEM_STUFF);
			return Integer.MAX_VALUE;		
		}
		if (string.contains("children")){
			if(cat.toString().indexOf('/')!=-1){
				cat.setTag(ICategoryModel.SYSTEM_STUFF);
				return Integer.MAX_VALUE;
			}
		}
		return 0;
	}

	@Override
	public String name() {
		return "system";
	}

	@Override
	public boolean isPossibleCategorization(Category cat) {
		return false;
	}

	@Override
	public String getPrimaryParentForm(Category cat) {
		return null;
	}

}
